#include <cinttypes>
#include <string.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>

using namespace std;
class USD;
class CNY{
public:
    CNY(float v): _value(v){

    }
    float getValue(){
        return _value;
    }

    friend class USD;
    
    operator USD();

private:
    float _value;
};

class USD{
public:
    USD(float v): _value(v){
        
    }
    
    const float getValue(){
        return _value;
    }

    operator CNY();
    USD& operator=(const CNY& rhs){
         this->_value=(rhs._value/(7.2));
         return *this;
    }

    friend class CNY;
private:
    float _value;
};

USD::operator CNY(){
    return CNY(this->_value*7.2);
} 

CNY::operator USD(){
    return USD(this->_value/(7.2));
} 

void test(){
    CNY c1(72);
    cout<<" -- c1： "<<c1.getValue()<<endl;

    USD u1(c1);
    cout<<" -- u1： "<<u1.getValue()<<endl;
    
    USD u2(CNY(144));
    cout<<" -- u2： "<<u2.getValue()<<endl;

    USD u3=c1;
    cout<<" -- u3： "<<u3.getValue()<<endl;

    CNY c3=u3;
    cout<<" -- c3： "<<c3.getValue()<<endl;
}

int main()
{
 test();
 return 0;
}

